package com.company.cloud.acct.modules.api.request;

import com.company.cloud.acct.modules.api.constant.AcctOpTypeEnum;
import com.company.cloud.common.bean.BaseParam;
import com.company.cloud.common.constant.BaseConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Map;
import java.util.Set;

@Getter
@Setter
public class AcctOpRequest extends BaseParam {

    @ApiModelProperty(value = "用户ID", required = true)
    @NotNull(message = "用户不能为空")
    private Integer userId;

    @ApiModelProperty(value = "账户分类【AcctTypeEnum】", required = true)
    @NotEmpty(message = "账户分类不能为空")
    private String type;

    @ApiModelProperty(value = "是否需要明细账户【YNEnum】", required = true)
    @NotEmpty(message = "是否需要明细账户不能为空")
    private String isAcctDetail = BaseConstant.YNEnum.NO.getCode();

    @ApiModelProperty(value = "账户操作【AcctOpTypeEnum】", required = true)
    @NotEmpty(message = "账户操作不能为空")
    private String opType;

    @ApiModelProperty(value = "关联业务流水分类", required = true)
    @NotEmpty(message = "关联业务流水分类不能为空")
    private String relObjType;

    @ApiModelProperty(value = "关联业务流水号", required = true)
    @NotEmpty(message = "关联业务流水号不能为空")
    private String relObjNo;

    @ApiModelProperty(value = "账单操作金额", required = true)
    @NotNull(message = "金额不能为空")
    private BigDecimal fundOp;

    @ApiModelProperty(value = "账单扣税金额", required = true)
    @NotNull(message = "扣税金额不能为空")
    private BigDecimal fundTax = BigDecimal.ZERO;

    @ApiModelProperty(value = "账单实际金额【无需填写,动态计算值】")
    private BigDecimal fundReal;

    @ApiModelProperty(value = "账单金额过期时间[yyyy-MM-dd HH:mm:ss]")
    private String overdueFundDate;
    
    //bill
    @ApiModelProperty(value = "关联业务名称", required = true)
    @NotEmpty(message = "关联业务名称不能为空")
    private String relBizName;

    @ApiModelProperty(value = "账单业务类型(字典)", required = true)
    @NotEmpty(message = "账单业务类型不能为空")
    private String busiType;

    @ApiModelProperty(value = "关联业务创建时间[yyyy-MM-dd HH:mm:ss]")
    private String relDate;
    
    @ApiModelProperty(value = "账单备注")
    private String memo;

    @ApiModelProperty(value = "账单标签")
    private Set<String> tags;

    @ApiModelProperty(value = "账单扩展信息")
    private Map<String, String> extendMap;

    //
    @ApiModelProperty(value = "操作人用户ID", required = true)
    @NotNull(message = "操作人用户ID不能为空")
    private Integer opUserId;

    @ApiModelProperty(value = "操作人IP", required = true)
    @NotEmpty(message = "操作人IP不能为空")
    private String opIp;


}
